// Copyright 2024 The Google Research Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto2";

package ambient_sensing;

import "mediapipe/framework/calculator.proto";

message DropOnThresholdValueCalculatorOptions {
  extend mediapipe.CalculatorOptions {
    optional DropOnThresholdValueCalculatorOptions ext = 291833308;
  }
  // Threshold that is used to filter input data streams. Only data where
  // reference value >= threshold will be passed. The number of thresholds has
  // to match the size of the reference stream. Thus, if the reference is a
  // vector with three elements, threshold has to carry three values, as well.
  // The threshold[i] will be used to assess INPUT_REFERENCE_VALUE[i].
  // If invert_threshold is set, the data not matching the criteria described
  // above will be kept.
  repeated float threshold = 1;
  // Comparison method used to filter input packets.
  enum Comparator {
    UNDEFINED = 0;
    // Drop if any reference value is below threshold.
    ANY = 1;
    // Drop only if all reference values are below threshold.
    ALL = 2;
  }
  // Depending on the selected comparator, it is sufficient if a single value is
  // below the threshold or all values have to be below the threshold.
  optional Comparator drop_below_threshold = 2;

  // Instead of dropping the values below the threshold, these values are kept
  // and everything else is dropped.
  optional bool invert_threshold = 3;
}
